package cn.iocoder.yudao.module.infra.dal.dataobject.base;

import cn.iocoder.yudao.framework.mybatis.core.dataobject.Base2DO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@TableName(value = "infra_base_tree")
@Data
@EqualsAndHashCode(callSuper = true)
public class TreeDO extends Base2DO implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String fullParentId;

    private String type;

    private String label;

    private Integer parentId;

    private String name;

    /**
     * 同父ID下的排序,默认为0，越大越靠前排列
     */
    private int orderNo;

    private String remark;

    private String attr;

    @TableField(exist = false)
    private String fullId;

    @TableField(exist = false)
    private String fullName;

    @TableField(exist = false)
    private String fullLabel;

    @TableField(exist = false)
    private List<TreeDO> children = new ArrayList<>();

    private static final long serialVersionUID = 1L;
}